package cn.edu.scau.cmi.liujianxun.client.fxUI.simpleFactoryMethod;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
import javafx.scene.image.ImageView;
import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.*;
import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.insurance.BodyInjur;
import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.insurance.Collision;
import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.insurance.Comprehensive;
import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.insurance.Insurance;
import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.insurance.PersonInjur;

public class SimpleFactoryMethodDemoController {
	@FXML
	private Label lbName;
	@FXML
	private Label lbNum;
	@FXML
	private ComboBox<String> cbBox;
	@FXML
	private TextArea textArea;
	@FXML
	private ImageView imageView;
	@FXML
	private Button bt;

	String[] s = {"司机受伤", "汽车损坏", "人员伤亡", "多种事故"};
	
	public SimpleFactoryMethodDemoController() {
		
	}
	public void init() {
		cbBox.getItems().addAll(s);
	
	}
	
	public void btEvent() {
		String result = InsuranceFactory.getInstance(cbBox.getValue()).getInsurInfo();
		textArea.appendText(result + '\n');
	}
}
